<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:ace="http://www.icefaces.org/icefaces/components"
	xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head>
<title>Geo Place</title>
<link rel="stylesheet" type="text/css" href="./xmlhttp/css/rime/rime.css"/>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html {
	height: 100%
}

body {
	height: 100%;
	margin: 0;
	padding: 0
}

#map_canvas {
	height: 100%
}
</style>
<script type="text/javascript"
	src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBb6vmvc_7HzHLfi7Iq7q5HBn8Ynr55wmA&amp;sensor=false">
    </script>
<script type="text/javascript">
    
    
   function initialize() {
	   
					var latinput = document.getElementById('lat');
						var loginput = document.getElementById('log');

						var myLatlng = new google.maps.LatLng(latinput.value,
								loginput.value);
						var myOptions = {
							zoom : 14,
							center : myLatlng,
							mapTypeId : google.maps.MapTypeId.ROADMAP,
						}
						var map = new google.maps.Map(document
								.getElementById("map_canvas"), myOptions);

						var marker = new google.maps.Marker({
							position : myLatlng,
							title : "Hello World!",
							icon: "Restaurant.png"
						});

						// To add the marker to the map, call setMap();
						marker.setMap(map);

					}
				</script>
</h:head>


<h:body onload="initialize()">
	<div id="map_canvas" style="width: 100%; height: 50%"></div>
	<ice:inputText id="lat" value="#{google.lat}"></ice:inputText>
	<ice:inputText id="log" value="#{google.log}"></ice:inputText>
	<h:form id="form">
		<h:outputText value="GEO" />
		<ice:panelGroup onclick="initialize(-34.397, 150.644)">
			<ice:outputText value="Zipcode:"></ice:outputText>
			<ice:inputText id="zipcode" value="#{google.zipcode}"></ice:inputText>
			<ice:outputText value="Keyword:"></ice:outputText>
			<ice:inputText value="#{google.keyword}"></ice:inputText>
			<ice:outputText value="Type:"></ice:outputText>
			<ice:inputText value="#{google.type}"></ice:inputText>
			<ice:commandButton value="Search" action="#{google.search}"
				onclick=""></ice:commandButton>
		</ice:panelGroup>
		<ice:panelGrid border="1" columns="1">
			<ice:outputText value="Places"></ice:outputText>

			<ice:dataTable value="#{google.places}" var="place" rows="14" width="900">

				<ice:column>
					<f:facet name="header">
						<ice:outputText value="Name" />
					</f:facet>
					<ice:outputText value="#{place.name}" />
				</ice:column>

				<!-- Model number -->
				<ice:column>
					<f:facet name="header">
						<ice:outputText value="Address" />
					</f:facet>
					<ice:outputLink>
						<f:param name="lat" value="#{place.lat}" />
						<f:param name="log" value="#{place.log}" />
						<ice:outputText value="#{place.address}"></ice:outputText>
					</ice:outputLink>

				</ice:column>
				<ice:column>
					<f:facet name="header">
						<ice:outputText value="Ratting" />
					</f:facet>
					<ice:outputText value="#{place.rating}" />
				</ice:column>
			</ice:dataTable>

		</ice:panelGrid>
	</h:form>
</h:body>
</html>

